import http from '@/api/http'

export function getRoleInfo(params?: any) {
  return http.get({
    url: '/usermgr/role/list',
    params: params,
  })
}

export function addRoleInfo(data: any) {
  return http.post({
    url: '/usermgr/role/add',
    data: data,
  })
}

export function editRoleInfo(data: any) {
  return http.post({
    url: '/usermgr/role/update',
    data: data,
  })
}

export function editRolePermissionInfo(data: any) {
  return http.post({
    url: '/usermgr/role/permission/update',
    data: data,
  })
}

export function deleteRoleInfo(params: any) {
  return http.get({
    url: '/usermgr/role/delete',
    params: params,
  })
}
///////////////////////////
export function getUserInfo(params: any) {
  return http.get({
    url: '/usermgr/user/list',
    params: params,
  })
}

export function addUserInfo(data: any) {
  return http.post({
    url: '/usermgr/user/add',
    data: data,
  })
}

export function editUserInfo(data: any) {
  return http.post({
    url: '/usermgr/user/update',
    data: data,
  })
}

export function deleteUserInfo(params: any) {
  return http.get({
    url: '/usermgr/user/delete',
    params: params,
  })
}

///////////////////////////
export function getPermissionInfo(params?: any) {
  return http.get({
    url: '/usermgr/permission/list',
    params: params,
  })
}

export function getPermissionTreeList(params?: any) {
  return http.get({
    url: '/usermgr/permission/tree-list',
    params: params,
  })
}

export function addPermissionInfo(data: any) {
  return http.post({
    url: '/usermgr/permission/add',
    data: data,
  })
}

export function editPermissionInfo(data: any) {
  return http.post({
    url: '/usermgr/permission/update',
    data: data,
  })
}

export function deletePermissionInfo(params: any) {
  return http.get({
    url: '/usermgr/permission/delete',
    params: params,
  })
}
